package com.ihg.hiex.entity.data.reference;

import org.apache.commons.lang3.StringUtils;

import com.demo2do.core.utils.Alias;

/**
 * 
 * @author mohanlan
 *
 */
@Alias("SessionPhase")
public enum Phase {
    
    BEFORE("会议前", "before", "PREPARATION", "success", "session.phase.before"),
    
    DURING("会议中", "during", "CENTER DAYS", "danger", "session.phase.during"),
    
    AFTER("会议后", "after", "AFTER CENTER", "warning", "session.phase.after");
    
    private String description;
    
    private String alias;
    
    private String display;
    
    private String css;
    
    private String message;
    
    /**
     * @param description
     * @param alias
     * @param display
     * @param css
     * @param message
     */
    private Phase(String description, String alias, String display, String css, String message) {
        this.description = description;
        this.alias = alias;
        this.display = display;
        this.css = css;
        this.message = message;
    }

    /**
     * 
     * @param alias
     * @return
     */
    public static Phase aliasOf(String alias) {
        for(Phase sessionPhase : Phase.values()) {
            if(StringUtils.equalsIgnoreCase(sessionPhase.getAlias(), alias)) {
                return sessionPhase;
            }
        }
        return null;
    }
    
    /**
     * @return
     */
    public boolean isBefore() {
        return this.equals(Phase.BEFORE);
    }
    
    /**
     * @return
     */
    public boolean isDuring() {
        return this.equals(Phase.DURING);
    }
    
    /**
     * @return
     */
    public boolean isAfter() {
        return this.equals(Phase.AFTER);
    }
    
    /**
     * @return the description
     */
    public String getDescription() {
        return this.description;
    }
    
    /**
     * 
     * @return
     */
    public String getAlias() {
        return alias;
    }
    
    /**
     * @return
     */
    public String getDisplay() {
        return display;
    }
    
    /**
     * @return
     */
    public String getCss() {
        return css;
    }
    
    /**
     * @return
     */
    public String getMessage() {
        return message;
    }
    
}